#!/usr/bin/env slsh

import("gtk");
import("glade");

define my_destroy() {
   variable wdg;
   variable msg = "You called my_destroy()!";

   switch (_NARGS)
     { case 1 : wdg = (); }
     { case 2 : (wdg,msg) = (); }

   vmessage("%s was passed to my_destroy()\n%s",gtk_widget_get_name(wdg),msg);
   gtk_main_quit();
}

variable xml = glade_xml_new("howdy.glade",,);

glade_xml_signal_connect(xml,"gtk_main_quit",&my_destroy);
glade_xml_signal_connect(xml,"gtk_widget_destroy",&my_destroy,"You destroyed me!");

gtk_main();

